<template>
  <div class="home-banner">
    <!-- 轮播图 -->
    <XtxCarousel :banners="banners" auto-play :current="2"/>
  </div>
</template>

<script setup>
// 获取banner数据
import { findBanner } from '@/api/home'
import { ref } from 'vue'
const banners = ref([])

findBanner().then(data => {
  banners.value = data.result
})

</script>

<style lang="scss" scoped>
.home-banner {
  width: 100%;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
  // v3中使用 :deep(选择器) 进行深层选择
  .xtx-carousel :deep(.carousel-btn.prev) {
    left: 270px;
  }
  .xtx-carousel :deep(.carousel-indicator) {
    padding-left: 250px;
  }
}
</style>
